package config;

import lombok.ToString;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import pojo.NoPopulateBean;

/**
 * @author: ZhouBert
 * @date: 2020/9/22
 * @description:	测试：注入的停止
 * step:
 * 1.注册 bean 保证 IOC 容器中存在该 bean;
 * 2.使用 @Autowired 将 bean 注入进来！
 */
@Configuration
@ToString
public class NoPopulateBeanConfig {

	@Autowired
	private NoPopulateBean noPopulateBean;

	@Autowired
	public void setMyTestBean(NoPopulateBean noPopulateBean) {
		System.out.println(noPopulateBean);
	}

	@Bean
	public NoPopulateBean noPopulateBean(){
		return new NoPopulateBean();
	}
}
